import VXETable from 'vxe-table'
// 创建一个简单的输入框渲染
VXETable.renderer.add('cusInputSearch', {
    // 激活时自动聚焦
    autofocus: '.my-cell',
    // 可编辑激活模板
    renderEdit (h, renderOpts, { row, column }) {
        console.log(renderOpts, column)
        const { events, props } = renderOpts
        return [
            <a-input-search
                size={props.size}
                allowClear={props.allowClear}
                v-on:search={ () => events.search({ row, column }, row[column.property])} v-model={ row[column.property] }></a-input-search>
        ]
    },
    // 可编辑显示模板
    renderCell (h, renderOpts, { row, column }) {
        return [
            <span>{ row[column.property] }</span>
        ]
    }
})
